import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import '../models/Foods.dart';

class FoodTitle extends StatelessWidget {
  final Food food;

  const FoodTitle({super.key, required this.food});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.only(left: 25.0),
      padding: const EdgeInsets.all(10.0),
      decoration: BoxDecoration(
          color: Colors.grey[100], borderRadius: BorderRadius.circular(20)),
      child: Column(
        // crossAxisAlignment: CrossAxisAlignme,
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          Image.asset(
            food.imagePath,
            height: 140,
          ),
          Text(food.name, style: GoogleFonts.dmSerifDisplay(fontSize: 20)),
          SizedBox(
            width: 160,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Text(
                  '\$${food.price}',
                  style: TextStyle(
                      fontWeight: FontWeight.bold, color: Colors.grey[700]),
                ),
                Row(
                  children: <Widget>[
                    Icon(
                      Icons.star,
                      color: Colors.yellow[900],
                    ),
                    Text(food.rating,
                        style: const TextStyle(color: Colors.grey))
                  ],
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
